
from hello import Hello
from hello.ttypes import *

from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from thrift.server import TServer

class HelloHandler():
	def __init__(self):
		pass

	def say(self, name):
		word = "Hello, %s"%(name)
		print word
		return word

handler = HelloHandler()
processor = Hello.Processor(handler)
transport = TSocket.TServerSocket(9090)
tfactory = TTransport.TBufferedTransportFactory()
pfactory = TBinaryProtocol.TBinaryProtocolFactory()

server = TServer.TSimpleServer(processor, transport, tfactory, pfactory)

print "Starting Server..."
server.serve()

